﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Farigola.Engine.Reposit;

namespace Farigola.Engine.TestUnit
{
    public class EngineCommonTestUnit
    {
        //---------------------------------------------------------------------
        /// <summary>
        /// Create the engine core, init it and return it.
        /// </summary>
        /// <returns></returns>
        public static Engine CreateInitEngine()
        {
            Engine engine;

            engine = new Engine();

            engine.Init();
            return engine;
        }

        //---------------------------------------------------------------------
        /// <summary>
        /// Create the engine core, init it and return it.
        /// </summary>
        /// <param name="engineReposit"></param>
        /// <returns></returns>
        public static Engine CreateInitEngine(IEngineReposit engineReposit)
        {
            Engine engine;

            engine = new Engine(engineReposit);

            engine.Init();
            return engine;
        }

        //---------------------------------------------------------------------
        /// <summary>
        /// Create an engine, init it and return the workspace.
        /// No repository is set.
        /// todo: use fake it easy.
        /// </summary>
        /// <returns></returns>
        public static Workspace CreateInitEngineWorkspace()
        {
            Engine engine= CreateInitEngine();
            return engine.GetWorkspace();
        }

        // create the engine core, init it, create a project and return it
        // pb, return engineCore et Project, pas possible en java!

        // use FakeItEasy to fake the engine repository
        // todo:
    }
}
